<!DOCTYPE html>












  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">









  
  
    
  
  <link rel="stylesheet" media="all" href="https://cdnjs.cloudflare.com/ajax/libs/Han/3.3.0/han.min.css">




<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



















  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






  

<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=6.3.0" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=6.3.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=6.3.0">


  <link rel="mask-icon" href="/images/logo.svg?v=6.3.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '6.3.0',
    sidebar: {"position":"left","display":"hide","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: false,
    fastclick: false,
    lazyload: false,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="PlantUml文档 PlantUmlPlantUML 是一个画图脚本语言，用它可以快速地画出：时序图, 流程图, 用例图, 状态图, 组件图.  安装在博客目录下执行如下目录, 安装PlantUml插件1npm install hexo-tag-plantuml --save 使用类图包你可以通过关键词 package 声明包，同时可选的来声明对应的背景色（通过使用html色彩代码或名称）, 包">
<meta name="keywords" content="uml,hexo">
<meta property="og:type" content="article">
<meta property="og:title" content="在hexo中画图-PlantUml">
<meta property="og:url" content="http://codertang.com/2019/02/21/hexo-drawing-plantuml/index.html">
<meta property="og:site_name" content="Tonny&#39;s Blog">
<meta property="og:description" content="PlantUml文档 PlantUmlPlantUML 是一个画图脚本语言，用它可以快速地画出：时序图, 流程图, 用例图, 状态图, 组件图.  安装在博客目录下执行如下目录, 安装PlantUml插件1npm install hexo-tag-plantuml --save 使用类图包你可以通过关键词 package 声明包，同时可选的来声明对应的背景色（通过使用html色彩代码或名称）, 包">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/XOn12i8m44NtESLGTq83rcqtqYu5pp36iKJJ96JIXMZkxf1svyBFm8V7_1VHF74YQ0Q7pDR049mZastmtC1kh86t0hXS7yAX_xGjd5B2rzboLaMfk2ayPSrXIORk8KsaeqEVbzdzh4UQmq5ORTYle1CWzq-cR_9RZUk-Wtup7eKLLRu0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/RSmz3i8m343XtQVm4UXFob9rAM9au0OcCGLXSDMawe1wTz8DfLdUzEbvIy9uD0TSdYuyO2Jxee7nhbfWsrxKSTVX5n2jaFVORorWXNzPHdbb6-WpI8QN2QyYFwiudlQsIcozsOdUcMsTK1DfBpgxFJK9RI8zKQ0R-SouWVK7">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/PO_D3e8m48JlVOezwe4ty6B4H1ELH23660zBivgQif2s7FnxTw50W7ZQpCotiorcrXcK3gH6Qs7PoPsoJc2VzUwgq9gaKmKBnOxC3IM1HmSvOaGJmU8J1DFU0Pc6uzKfqnxvvtmswHwBhjqOVFfCT7_i3NWBW2Xxr5sNAv2cdDY5wB2shNhHR2w-GX1NEIGgfvHLkn8kpt4zDb5wREP-UqYJTTomo5muz2-Bgx8qPEq93Ik-sny0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Iyv9B2vMS2dDpQrKgEPIKAWkBaaioKokLGWkAShCIrV8J0499YOLbnGb9fVKAfJbPwOevAQMPEId56jeSjK20000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syv9B2usC5ImgT7LLN06Suou8BInWfAXae8MK5mfDp6lKWagRGALDbN8XsinKx1II4nFBqfDJop9pC-3gZ1NqDE3Ah202bagW8mpX9fbQ000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syv9B2usD5ImgT7JKt06Suou8BInWgwk7LJC12fcgg2d1nCpWugP0yLgO88MK45B1HjTNIs8e9410000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syv9B2usCbHGrjLLS0QpZRWWjB521LpC12fcgb0B5pE3YfahQCF5BA1YbWfnC35Z0m00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/2yhFprN8rrK8BYbDISqhuGe2yRLqTHMSCn8pYxYuWfCpylDp57Jp5K9I4vCpKekudFDBYufJ5NHrjM120000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/IylFLz3DIKqhqRLJI2dDpQtq0R8LkD90maMPwHbmyI0G1ofHMW0J3Is02gNab-V115s0R000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Iyv9B2vM22ufJKdDAr6evb9Gy4lCJUMgvO89AHdewMafAUWgA1c26SxvfKN5gLmQK7aTg82cWfwUWcjUKNvEJYvGc8ih6MmmGWHiTafHVe669f2Hd9YNd9e3PDO20000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/DOin3i8m40JxUyMMKEG3YD92eg613npuS2pb4dG-HqAGlnECw7OrCw6gFh5_TnqEGqwz4zq6BWMXWHS1PxSy9aHsNjyyvGWLxwTODbjQ_lwlRW7kRP-gNiMmmt5qIM9V4kN1vjNaabLM5DY5bWy0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Iyv9B2vMS2dDpQrKgEPIq4tBJCr9CUHIK0OpZBWKjC4COow5kjpKaepy54CDJQ0iX6q4Ocj3sCP0TYq0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/AyxEp2j8B4hCLKZEIImkTYmfASfCAYr9zKpEpmlEh4fLCE02IoYubERcLYfKSodefcMcvgGOSYaeWnb6N0hQO8Onbq9TRcf9HdwAeOOcK1R2DWAnjI5iOo2x5W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/PO-nQiGm44HxVSMKES8PyW5Nf4ZIfJbIf3ABjR45jcIqQnyctB_VIYPWI3FiB9hHssua4Rodz89V1tod1Hr5BCBcX5VED68CaSLyqvYGOBDNDufQNFJeSrfccoyN4nr2x0MQUjQ1SqcqxQ5ve9LBnqHnsvFoh_HyDdcpvlI3hW2wktDrm9TmhgHDWskOvf7nmQgsh73Fi6y_QUAdqvzxzJwpI5sKK9hO3Zj6v11fMymvhAGCJqexUuWAwhcIWMENjrdPxvXNpNOmPeExfUpT_G40">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/JOx12eD034JlViNWkGhrA2BqKYWKlVJePQlHAf8KDqY5VdntjO8GI7QIsNdrQAn5-HoeLcGPEcAQp8Wy3tRn6qKHBjDabdjlDGXObA3oXhIxCSMDCPZPd40pJGjg_st5z57Yna9VlOKmnNzt-F22AuDs5ACzT_2B4CQYE1-Frj7rMfXT53KLgy3w68SfQxwDDsEoCyUnVnI97mxaAnMk8bl0IAscA1bELZJKzapDXlu3">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/LOqn2e0m34LdUueFpYwE3e8WtgDei4LDeOs3jpTMH8KGoEUzdt6rAQ7Vj-qmUQEgMWmXe467rVDYE0WXS3vGHfeQv4YS5VW4JSpVhIzP6KVnKn7zxEGjcYCHcqASLkYe_JowmImMbYTunWsJ7XTq0W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuGBAAUW2rJY256DHLLoGdrUSoiNbY6fONZvGNP528dP38OfjT7KXgXDngOOO3W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/IqmkoIzISClFD-HAoY_DIqaigWJnZBWUzJI36CPSgNabcILWGHEkbCIInAJ4ubGGpvGhEJyd9pMv93C_hnWaOCO5CaP1rmviW8ALGaY-0inCP2bZY1JG0cHH4uWen3Pa2LE81CngP2apY1IIEm00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/AqWiAibCpYn8p2jHy4aiBb78Bqf9BL8mDk0gG9BnpKn9oKc5oXcXohbb5i6r6He00000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/SyfFKj2rgr1mpCbCJkLo0lDGE2Yy62HEJ8mk4azVNnV6XMhCHvBD1of6aRP1iSK6hXe0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/SyfFKj2DLYvAJOcrKt3CoKnELR1Io4ZDoSddWl20aWP0uEOMgsld15HifP2V3G00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/IomjoSyhpKrABU9ooazIqBLJSCp9J4vLi59mB2t9ICqhoKnEBCdCprC8IYqiJIqk0QkoqSMjghWWFwyu5G00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/IomjoSyhpKrABU9ooazIqBLJSCp9J4vLi59mB2t9ICqhoKnEBCdCprC8IYqiJIqk0QkoqSMjghWWFwyubOih4MwmWg4fXjbv-K1jHGg9nDc1IpKMkqmC50mDqAsBJ2rHI2J9Ihmw8DO20000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/nS-n2i9030RWlKyHkXUkgzH2tLtSH1pksgW7lKkz98Dlx-aYLHJ1GSZu9_b-gq9HWyC4jRbDsRXsPupPbyMA75GjTAFl4HRGgPmmYk-jU8gmmRCYoptLLEzJF55aB0hx-CH2q_FrGKEup589MGDcq86YG4yZfMN2eSt0DJBR8u81U65kKS16oee4zYlonurV-VMyW1iL_zBW2W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/XL1BJWCn35qdftWNg3Hikq0AGgm0LN22DECfKTCun8wgtfxC32n6IE255tuV-zcb60YxUppmSG_Nz8Eonk0rSiORVJOIjTOdXRGGI6Hg2S4BMMkwP5QwsUANrdLsKHgjiPI487mXd6CUmHCc7rEh_teyVTFCgN8hUBc1hnd97obPOzpFwSzymdxfNjM7CqHzLMlGAp4Nt0t308qNadKubzi4VtnzXrl4AuFo-EU61L_QcivbxfTNwAtG9c3tsaOy9EhVGwL2NcVOTfil">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/JOqn3iCW40HhxXNx0N_0XIMdopFEvZ38bqC2bFS7XyAMjjgTqQwQTfcMLzum8ufg9ijDe1BQZ1PJHGyZf58RhecemzEoNc9tyZc4aexuD7ePfJoDyV46VoxApcJ7_KME1-jsDh3MZ4tW9IGJJouRgdobi49xKqdC__aV">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/TP0n3i8m34Nd-1IMkbOz05iPUW965jCwJQIGX3GWUdjIWbggWEN9Vl_Btvv2rBtsP2EsHlSC_cjoT1UmBZ8QbX6Tp0XMTBiJY9FI4wOUzEGDpJmWY1tO8B0TS740p4P1Zse33bXwx8a6iiuzEFpNRDkIhvSKM7LTc-g7-6mpl52KhYrjqgR-F6VDF7DCj8kA0mX-qjMRH4iGXCRPyPsvMTE_0000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/TSqn2e0m30NGFQV81Ne1CO9khjwWbe01ITN6nTCRx5h7pt_99y9PnIJkyaIJh4W4CEwI6CE0Krux76_RM4rI1GkVDnS3xp2u-N13bIDhOG0Y3mUR_BtNx9SNnlPCnNq8LSS_NUTU">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuTBJq-C2oYle0jKvWZHWKLbSa9zNd0fIQggGcvbNMf9Qh92JM5AIMeH5jrDbge8Y0000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFibB8JIqkJanFLJ3a0d8LT872ZY1vAuNyRAwQcXekHwogZR2gDZ75gS4OKmC0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/LO-n3i8m34HtVuKbvln05KLAg2gnWX03avLwY1gIaWQ-dz0629vyv-UJRgQKdNKpXOpdXHF0LQXrwx2FbvWcWBV2ukglHJQx9sL6ZRjXC6K0T4KE8NCAvD6IztzaJsawaR_5K6dJePHe4nVWoFS7BncL-lsKL8DYYwtt_GgFC793DK9loPy2WKiXALhTmYy0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/RSgn3O0W44RXdYbk0HUmCC720Tn0u3TSWfp2OHnVOctvyhx80RIBg9F7A6i2BRrGgE2G6y4OczY3XebcSIFPfX5PsM_Aacd5rL3Lz4T3Dn_-KVMKNF42">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/IyglK53op2j9BSfBp548JYqgoqnELL9GzibCpoXnoYbDvU8iI2mgoKpEB4ZCAr5moaz25N3C0QhdIirBKKZAh-12bl4loKWjuk82wb3GjOEeKx1Io4ZDoSddWl20mc15C640">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/Aov9B2hXil98pSd9LoZFByf9iUQo2id8B5O0elmyXPJKjCoyr1GWawiujIorA357GKih1oXKhALbpPMQbm80">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/ROqz3i8m38Ltdy9Zky969-0Ax56KkCLIiKji4BazAKoWoilpf_TZ7ei3y8XTKidih8B77lrAWbqbwm7nCEbw0z1iz6iz_Lilz7BS3KsQwxAHE6yczjzox4G_S2cQo0nLvjh-48pk3v948M2Kt41Cpa_ssa3cE9LuizRHLaQ0TVeD">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/BSf12e0m30J0UrwHetx17dpBGfPQiBOa0RylYiU1YOIdY7CIAQgR4wQ6H7bLUT6HL6keZXxbhteVxQGkVJY_lgyYaMC-">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/7Sj12e0m34JHVKwHfLx1BZpBI8PQQAkaGQylTVbv_17m47dFKgcB8Q1uK2gEodqLrSq9qmbfLcQd8wXMa1rj966tVnSPSTqV">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/NSmn4a1038NXsfuY9IKbXKkum0vPTf2O90gtjpiqjE_D_wbvCUTYW78_Duk7y8YgB7q5jY11UQ5M3Y2mhAve1q5lEv91tRqh-Db7-dnD_f2cfy9DCV5CdFMC_Pblci8ORW00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/9Own3i8m34JtV8NL2LWY6DlIXOK1jlw0sxfDf61NYSNtumRBqadFf_CLnQokNKMkdLkJe4RUW4K94gtQmXXY0Lkii3fldQk67BUW3lwMIao5eT2NCYQxU9yYK_4Ua1UOaOtDmegHeP-6v_X-zNuQZDvjJ2xmm9IE2Xe8FgH15cWQUtewDysHlsS9SOfAYoFBhAMAolu3">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/DOv93i8m34NtEOKbDX2rbPWsHEefs2348ctSGKGsIboWjoSTMFg_h_TzQPZtHkKbt7Y0sXAy1W71hm0Js13u4utg6zWAHjc1T4WA8BzlAZ_W8o_JSKcEWrdIDY1Ivcpiq2KArmuNMrAdXlMHeSB97V6DmNhmFM6S43dGEcMZrk2Psg8ep6e_6eK-ud_Ori_CiSWyiLPEgKAkRzJyX1spYlsC9tWsFm00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/JOn13eCm30JFpIlyZl82hlt15X9aANKYnxGIYB_ZmAKNMvvTJpEeXUg3ZOlGABwHUSDrxk7nr8YPfYA95qgSu-2ClKOi5bMGwGjbl7jo_AbUgmZBSZb-y7ugIckBUZzYwgqkg-h0eUSVtF08eLcf9m00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/gmakpypDISnBDQpXAYv9B2hXiahBppUqvgfHTimhoImiJGtFo2n9hO4fCwe1Ap2o1bF6G7L81e24J924e8fDhO56vnS00000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/ioekIImgiUPIICilokPIK52mIilFDxI6iOoWCWg9wOcPUJ1HOx1yIcf9Od86bq9gNWf4SsQQWWPGraHJeIGZ5QxO55rnPXeNMC8CA04J1l7DWVpYalm20000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/NL4xSiCW5Ap5ALufDJu0Ab9u9fbq6li46hIo61DGuCaUtpvyX9Eu0jv-M9R0esSXZqQhwnd-Pi27PRIJmGdV6mAtNI-anPtMyO9Uw9dQ8UuEpfwXDg_vSLoWhXtn0aij-msT898xwTFgR46Kb3gyEtyV_VHM-TPref63TmeXa7AMlJEX5qsYfwEs6sWjkBQN_qAYm6uL3UoaPz4KbGw32_maFX0oioPAO4hKm0GyVIhwWHqiZdLyYcVuyf025VKyngKJPPJBcHnvJDf3lKI8TrIWlgVFBditKJY_b5EYoxspw9j_96VupIvBjlm_nFXQpSZuaxD4Iptz0000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/qt3BB2ekKIWjJarEB4xLvD9mpCiloKWjWeie91OhQ8Gw6sagA711nHH2dOtXR0sVnEAIc3navQ7E9W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/itBBB2ekKN1CBialikAoSipBByb8BOh9ImGBA2GMA_YcvXafA7211K0SOoZJoYSHg155dGa0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/HOwn2W8n44JxVCLYVm5RuGgvJr0BopLPDR1aZqoY-FScgDWjC_CUso218NHQjiIWpTaQ1SxK80xoaC9AchA0gb6KQp_fPQsCmG2z-n6ii94IPEN2rGgycoPt-5h-CN4HMWr85-s2UNRx78VruucHQgegs3dl5yj16v9bxztndZgiQa-GShb9_mYXfBMEVlC6">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/VOon3O0m30JxJF4b52oG0ea1g82Ena0aB3aEIjomFO41wFvVTx-KaD7rQ2QZRArRlluEDS7E0BekuPsCaxRm650YYK1e2-AS7uaLmn5PVVL-nFda0Ywhti50cYgIL_rk7W00">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/i_9DpCnJS4p9pSopKaWiXh2uD4ABKnLACb8L4WiASZAJ4qioy_CqGT8W2KqkBY1Pf61JewiBKnzSabXKeWaH0gi10000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/NOyn3i8m34NtdEAhKplGeMC7f1w0Bi36uhQ61gLEbKI8uvEa5KX8KVBz_6t7xOcqe9iMBIt8RqgLLyy8CuFMrUYHWhPIfNHAL4h5s-5mH7aEv4Arnmbi-TmbWXyH6nXEF-O0Uz-ceCLbrXxna83VjAo6wt_hLWzqo7oCLZBUHZ8mhC3pYnqP62ti5SkKVNkN8W_8ChwZ5U4ny7IJOB-5TdX6wEiYxTStQjy9TPsYlaaYV-83">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/ioejJYsoKj3LjLFG22rELKXE11A6cbnMK75aOIDD0000">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/qmWjJbL8JWGIXfeADdfw2bQbnQb5LbmQS74ZeBWkL1W0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/ioejJYsoKj3DIKqhqRLJq4WfpSsjz05oD1MuhA1oHPdf6GZ9810FIRQq02uLMg095qx9By-3IxW0EPe0">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/oqbDAr4eoLSeoapFA558oInAJIx9pC_ZAYrEBJ9KqDMrKz08BKvDJYnELJ3K18iQeOeQQG80">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/TP31ReD034JFyLVus1pw0r64b2OgkQGve1vwTC0gAvOrDQOeglhlPGbDaL2FddcUyMvRkT2GKeqbXQ9NPyO1JJi6QEzUrt9EBUCNh9uehzvLkb3inOlYWRJAc59b3eChMh3E74_6gT8L5flRBPx81KmIV6FlfLz6_8V0QgSg_QtcxDqd3qfkelFwYn_w9lrPWhrGpRYNJXqh_FABauvTJMDXAhw0Ru3NbXLd1cp6amvaT1c-P8FKukcQVVW8xPh6kvpCoOW-P4Pgw-YS0sDMYetoa8bMCj8VleuvqHZfwTLJ-sE2Kz8qHo6Y0BVck_03">
<meta property="og:image" content="http://www.plantuml.com/plantuml/svg/LOv12eCm44NtESLVseKzW8jUeYSO9bCJ4fEGZ50flNiLKUdoyHwV7-Mbq8pgHwUmlWghpycqu5EXIXCASQ1Hdhf4mQOfZL4CiUOAdflcIUg1KMemPmHsmY7FYe_1sQBlqHtcjeeBS7-WAxHCabOOu1F7sShME8bbzrSzGDugoRR_aNL_F_Bz0G00">
<meta property="og:updated_time" content="2021-02-25T09:25:48.210Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="在hexo中画图-PlantUml">
<meta name="twitter:description" content="PlantUml文档 PlantUmlPlantUML 是一个画图脚本语言，用它可以快速地画出：时序图, 流程图, 用例图, 状态图, 组件图.  安装在博客目录下执行如下目录, 安装PlantUml插件1npm install hexo-tag-plantuml --save 使用类图包你可以通过关键词 package 声明包，同时可选的来声明对应的背景色（通过使用html色彩代码或名称）, 包">
<meta name="twitter:image" content="http://www.plantuml.com/plantuml/svg/XOn12i8m44NtESLGTq83rcqtqYu5pp36iKJJ96JIXMZkxf1svyBFm8V7_1VHF74YQ0Q7pDR049mZastmtC1kh86t0hXS7yAX_xGjd5B2rzboLaMfk2ayPSrXIORk8KsaeqEVbzdzh4UQmq5ORTYle1CWzq-cR_9RZUk-Wtup7eKLLRu0">






  <link rel="canonical" href="http://codertang.com/2019/02/21/hexo-drawing-plantuml/">



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>在hexo中画图-PlantUml | Tonny's Blog</title>
  









  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Tonny's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">莫等闲, 白了少年头, 空悲切</p>
      
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">
    <a href="/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">
    <a href="/tags/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">
    <a href="/categories/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>
  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">
    <a href="/archives/" rel="section">
      <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>
  </li>

      
      
    </ul>
  

  
    

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://codertang.com/2019/02/21/hexo-drawing-plantuml/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tonny Yi">
      <meta itemprop="description" content="Coding, Life, Zen">
      <meta itemprop="image" content="/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Tonny's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">在hexo中画图-PlantUml
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2019-02-21 10:13:32" itemprop="dateCreated datePublished" datetime="2019-02-21T10:13:32+08:00">2019-02-21</time>
            

            
              

              
                
                <span class="post-meta-divider">|</span>
                

                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2021-02-25 17:25:48" itemprop="dateModified" datetime="2021-02-25T17:25:48+08:00">2021-02-25</time>
              
            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/hexo/" itemprop="url" rel="index"><span itemprop="name">hexo</span></a></span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <p><a href="http://plantuml.com/zh/" target="_blank" rel="noopener">PlantUml文档</a></p>
<h1 id="PlantUml"><a href="#PlantUml" class="headerlink" title="PlantUml"></a>PlantUml</h1><p>PlantUML 是一个画图脚本语言，用它可以快速地画出：时序图, 流程图, 用例图, 状态图, 组件图. </p>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><p>在博客目录下执行如下目录, 安装PlantUml插件<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-tag-plantuml --save</span><br></pre></td></tr></table></figure></p>
<h2 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h2><h3 id="类图"><a href="#类图" class="headerlink" title="类图"></a>类图</h3><h4 id="包"><a href="#包" class="headerlink" title="包"></a>包</h4><p>你可以通过关键词 package 声明包，同时可选的来声明对应的背景色（通过使用html色彩代码或名称）, 包也可嵌套<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">package &quot;Classic Collections&quot; #DDDDDD &#123;</span><br><span class="line">  Object &lt;|-- ArrayList</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package net.sourceforge.plantuml &#123;</span><br><span class="line">  Object &lt;|-- Demo1</span><br><span class="line">  Demo1 *- Demo2</span><br><span class="line">  </span><br><span class="line">  package net.sourceforge.plantuml.demo &#123;</span><br><span class="line">    Demo2 &lt;-- Demo3</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/XOn12i8m44NtESLGTq83rcqtqYu5pp36iKJJ96JIXMZkxf1svyBFm8V7_1VHF74YQ0Q7pDR049mZastmtC1kh86t0hXS7yAX_xGjd5B2rzboLaMfk2ayPSrXIORk8KsaeqEVbzdzh4UQmq5ORTYle1CWzq-cR_9RZUk-Wtup7eKLLRu0">
<p>包样式<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">scale 750 width</span><br><span class="line">package foo1 &lt;&lt;Node&gt;&gt; &#123;</span><br><span class="line">  class Class1</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package foo2 &lt;&lt;Rectangle&gt;&gt; &#123;</span><br><span class="line">  class Class2</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package foo3 &lt;&lt;Folder&gt;&gt; &#123;</span><br><span class="line">  class Class3</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package foo4 &lt;&lt;Frame&gt;&gt; &#123;</span><br><span class="line">  class Class4</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package foo5 &lt;&lt;Cloud&gt;&gt; &#123;</span><br><span class="line">  class Class5</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">package foo6 &lt;&lt;Database&gt;&gt; &#123;</span><br><span class="line">  class Class6</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/RSmz3i8m343XtQVm4UXFob9rAM9au0OcCGLXSDMawe1wTz8DfLdUzEbvIy9uD0TSdYuyO2Jxee7nhbfWsrxKSTVX5n2jaFVORorWXNzPHdbb6-WpI8QN2QyYFwiudlQsIcozsOdUcMsTK1DfBpgxFJK9RI8zKQ0R-SouWVK7">
<h4 id="抽象类与接口"><a href="#抽象类与接口" class="headerlink" title="抽象类与接口"></a>抽象类与接口</h4><p>用关键字abstract或abstract class来定义抽象类。抽象类用斜体显示。 也可以使用interface, annotation 和 enum关键字。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">abstract class AbstractList</span><br><span class="line">abstract AbstractCollection</span><br><span class="line">interface List</span><br><span class="line">interface Collection</span><br><span class="line"></span><br><span class="line">List &lt;|-- AbstractList</span><br><span class="line">Collection &lt;|-- AbstractCollection</span><br><span class="line"></span><br><span class="line">Collection &lt;|- List</span><br><span class="line">AbstractCollection &lt;|- AbstractList</span><br><span class="line">AbstractList &lt;|-- ArrayList</span><br><span class="line"></span><br><span class="line">class ArrayList &#123;</span><br><span class="line">  Object[] elementData</span><br><span class="line">  size()</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">enum TimeUnit &#123;</span><br><span class="line">  DAYS</span><br><span class="line">  HOURS</span><br><span class="line">  MINUTES</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">annotation SuppressWarnings</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/PO_D3e8m48JlVOezwe4ty6B4H1ELH23660zBivgQif2s7FnxTw50W7ZQpCotiorcrXcK3gH6Qs7PoPsoJc2VzUwgq9gaKmKBnOxC3IM1HmSvOaGJmU8J1DFU0Pc6uzKfqnxvvtmswHwBhjqOVFfCT7_i3NWBW2Xxr5sNAv2cdDY5wB2shNhHR2w-GX1NEIGgfvHLkn8kpt4zDb5wREP-UqYJTTomo5muz2-Bgx8qPEq93Ik-sny0">
<h4 id="抽象与静态"><a href="#抽象与静态" class="headerlink" title="抽象与静态"></a>抽象与静态</h4><p>通过修饰符{static}或者{abstract}，可以定义静态或者抽象的方法或者属性<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Dummy &#123;</span><br><span class="line">  &#123;static&#125; String id</span><br><span class="line">  &#123;abstract&#125; void methods()</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Iyv9B2vMS2dDpQrKgEPIKAWkBaaioKokLGWkAShCIrV8J0499YOLbnGb9fVKAfJbPwOevAQMPEId56jeSjK20000">
<h4 id="关系"><a href="#关系" class="headerlink" title="关系"></a>关系</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Class01 &lt;|-- Class02</span><br><span class="line">Class03 *-- Class04</span><br><span class="line">Class05 o-- Class06</span><br><span class="line">Class07 .. Class08</span><br><span class="line">Class09 -- Class10</span><br><span class="line"></span><br><span class="line">Class11 &lt;|.. Class12</span><br><span class="line">Class13 --&gt; Class14</span><br><span class="line">Class15 ..&gt; Class16</span><br><span class="line">Class17 ..|&gt; Class18</span><br><span class="line">Class19 &lt;--* Class20</span><br><span class="line"></span><br><span class="line">Class21 #-- Class22</span><br><span class="line">Class23 x-- Class24</span><br><span class="line">Class25 &#125;-- Class26</span><br><span class="line">Class27 +-- Class28</span><br><span class="line">Class29 ^-- Class30</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/Syv9B2usC5ImgT7LLN06Suou8BInWfAXae8MK5mfDp6lKWagRGALDbN8XsinKx1II4nFBqfDJop9pC-3gZ1NqDE3Ah202bagW8mpX9fbQ000">
<img src="http://www.plantuml.com/plantuml/svg/Syv9B2usD5ImgT7JKt06Suou8BInWgwk7LJC12fcgg2d1nCpWugP0yLgO88MK45B1HjTNIs8e9410000">
<img src="http://www.plantuml.com/plantuml/svg/Syv9B2usCbHGrjLLS0QpZRWWjB521LpC12fcgb0B5pE3YfahQCF5BA1YbWfnC35Z0m00">
<p>类之间默认采用两个破折号 – 显示出垂直 方向的线. 要得到水平方向的可以像这样使用单破折号 (或者点):<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Room o- Student</span><br><span class="line">Room *-- Chair</span><br><span class="line"></span><br><span class="line">School -o Teacher</span><br><span class="line">Course --* Teacher</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/2yhFprN8rrK8BYbDISqhuGe2yRLqTHMSCn8pYxYuWfCpylDp57Jp5K9I4vCpKekudFDBYufJ5NHrjM120000">
<p>也可通过在箭头内部使用关键字， 例如left, right, up 或者 down，来改变方向<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">foo -left-&gt; dummyLeft </span><br><span class="line">foo -right-&gt; dummyRight </span><br><span class="line">foo -up-&gt; dummyUp </span><br><span class="line">foo -down-&gt; dummyDown</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/IylFLz3DIKqhqRLJI2dDpQtq0R8LkD90maMPwHbmyI0G1ofHMW0J3Is02gNab-V115s0R000">
<p>你可以在定义了两个类之间的关系后定义一个 关系类 association class 例如:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Student &#123;</span><br><span class="line">  Name</span><br><span class="line">&#125;</span><br><span class="line">Student &quot;0..*&quot; - &quot;1..*&quot; Course</span><br><span class="line">(Student, Course) .. Enrollment</span><br><span class="line"></span><br><span class="line">class Enrollment &#123;</span><br><span class="line">  drop()</span><br><span class="line">  cancel()</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Iyv9B2vM22ufJKdDAr6evb9Gy4lCJUMgvO89AHdewMafAUWgA1c26SxvfKN5gLmQK7aTg82cWfwUWcjUKNvEJYvGc8ih6MmmGWHiTafHVe669f2Hd9YNd9e3PDO20000">
<h4 id="类方法"><a href="#类方法" class="headerlink" title="类方法"></a>类方法</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Dummy &lt;|-- Flight</span><br><span class="line"></span><br><span class="line">class Dummy &#123;</span><br><span class="line">  String data</span><br><span class="line">  void methods()</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">class Flight &#123;</span><br><span class="line">   flightNumber : Integer</span><br><span class="line">   departureTime : Date</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/DOin3i8m40JxUyMMKEG3YD92eg613npuS2pb4dG-HqAGlnECw7OrCw6gFh5_TnqEGqwz4zq6BWMXWHS1PxSy9aHsNjyyvGWLxwTODbjQ_lwlRW7kRP-gNiMmmt5qIM9V4kN1vjNaabLM5DY5bWy0">
<h4 id="方法可见性"><a href="#方法可见性" class="headerlink" title="方法可见性"></a>方法可见性</h4><ul>
<li>-            private</li>
<li>#            protected</li>
<li>~                package private</li>
<li>+            public</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Dummy &#123;</span><br><span class="line"> -field1</span><br><span class="line"> #field2</span><br><span class="line"> +field3</span><br><span class="line"> ~method1()</span><br><span class="line"> #method2()</span><br><span class="line"> +method3()</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/Iyv9B2vMS2dDpQrKgEPIq4tBJCr9CUHIK0OpZBWKjC4COow5kjpKaepy54CDJQ0iX6q4Ocj3sCP0TYq0">
<p>可以采用以下命令停用这些特性 <code>skinparam classAttributeIconSize 0</code>, 这样方法可见性修饰符就不会变成icon<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">skinparam classAttributeIconSize 0</span><br><span class="line">class Dummy &#123;</span><br><span class="line"> -field1</span><br><span class="line"> #field2</span><br><span class="line"> +field3</span><br><span class="line"> ~method1()</span><br><span class="line"> #method2()</span><br><span class="line"> +method3()</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/AyxEp2j8B4hCLKZEIImkTYmfASfCAYr9zKpEpmlEh4fLCE02IoYubERcLYfKSodefcMcvgGOSYaeWnb6N0hQO8Onbq9TRcf9HdwAeOOcK1R2DWAnjI5iOo2x5W00">
<h4 id="方法属性分组"><a href="#方法属性分组" class="headerlink" title="方法属性分组"></a>方法属性分组</h4><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Foo1 &#123;</span><br><span class="line">  You can use</span><br><span class="line">  several lines</span><br><span class="line">  ..</span><br><span class="line">  as you want</span><br><span class="line">  and group</span><br><span class="line">  ==</span><br><span class="line">  things together.</span><br><span class="line">  __</span><br><span class="line">  You can have as many groups</span><br><span class="line">  as you want</span><br><span class="line">  --</span><br><span class="line">  End of class</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">class User &#123;</span><br><span class="line">  .. Simple Getter ..</span><br><span class="line">  + getName()</span><br><span class="line">  + getAddress()</span><br><span class="line">  .. Some setter ..</span><br><span class="line">  + setName()</span><br><span class="line">  __ private data __</span><br><span class="line">  int age</span><br><span class="line">  -- encrypted --</span><br><span class="line">  String password</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/PO-nQiGm44HxVSMKES8PyW5Nf4ZIfJbIf3ABjR45jcIqQnyctB_VIYPWI3FiB9hHssua4Rodz89V1tod1Hr5BCBcX5VED68CaSLyqvYGOBDNDufQNFJeSrfccoyN4nr2x0MQUjQ1SqcqxQ5ve9LBnqHnsvFoh_HyDdcpvlI3hW2wktDrm9TmhgHDWskOvf7nmQgsh73Fi6y_QUAdqvzxzJwpI5sKK9hO3Zj6v11fMymvhAGCJqexUuWAwhcIWMENjrdPxvXNpNOmPeExfUpT_G40">
<h4 id="备注"><a href="#备注" class="headerlink" title="备注"></a>备注</h4><p>你可以使用<code>note left of</code> , <code>note right of</code> , <code>note top of</code> , <code>note bottom of</code>这些关键字来添加备注。<br>你还可以在类的声明末尾使用<code>note left</code>, <code>note right</code>, <code>note top</code>, <code>note bottom</code>来添加备注。<br>此外，单独用note这个关键字也是可以的，使用 .. 符号可以作出一条连接它与其它对象的虚线。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Object &lt;&lt; general &gt;&gt;</span><br><span class="line">Object &lt;|--- ArrayList</span><br><span class="line"></span><br><span class="line">note top of Object : In java, every class\nextends this one.</span><br><span class="line"></span><br><span class="line">note &quot;This is a floating note&quot; as N1</span><br><span class="line">note &quot;This note is connected\nto several objects.&quot; as N2</span><br><span class="line">Object .. N2</span><br><span class="line">N2 .. ArrayList</span><br><span class="line"></span><br><span class="line">class Foo</span><br><span class="line">note left: On last defined class</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/JOx12eD034JlViNWkGhrA2BqKYWKlVJePQlHAf8KDqY5VdntjO8GI7QIsNdrQAn5-HoeLcGPEcAQp8Wy3tRn6qKHBjDabdjlDGXObA3oXhIxCSMDCPZPd40pJGjg_st5z57Yna9VlOKmnNzt-F22AuDs5ACzT_2B4CQYE1-Frj7rMfXT53KLgy3w68SfQxwDDsEoCyUnVnI97mxaAnMk8bl0IAscA1bELZJKzapDXlu3">
<p>在定义链接之后，你可以用 note on link 给链接添加注释. 如果想要改变注释相对于标签的位置，你也可以用 note left on link， note right on link， note bottom on link。（对应位置分别在label的左边，右边，下边）<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">class Dummy</span><br><span class="line">Dummy --&gt; Foo : A link</span><br><span class="line">note on link #red: note that is red</span><br><span class="line"></span><br><span class="line">Dummy --&gt; Foo2 : Another link</span><br><span class="line">note right on link #green</span><br><span class="line">	this is my note on right link</span><br><span class="line">	and in green</span><br><span class="line">end note</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/LOqn2e0m34LdUueFpYwE3e8WtgDei4LDeOs3jpTMH8KGoEUzdt6rAQ7Vj-qmUQEgMWmXe467rVDYE0WXS3vGHfeQv4YS5VW4JSpVhIzP6KVnKn7zxEGjcYCHcqASLkYe_JowmImMbYTunWsJ7XTq0W00">
<h2 id="时序图"><a href="#时序图" class="headerlink" title="时序图"></a>时序图</h2><p>你可以用-&gt;来绘制参与者之间传递的消息， 而不必显式地声明参与者。<br>你也可以使用 –&gt; 绘制一个虚线箭头。</p>
<p>另外，你还能用 &lt;- 和 &lt;–，这不影响绘图，但可以提高可读性。 注意：仅适用于时序图，对于其它示意图，规则是不同的。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Alice -&gt; Bob: Authentication Request</span><br><span class="line">Bob --&gt; Alice: Authentication Response</span><br><span class="line"></span><br><span class="line">Alice -&gt; Bob: Another authentication Request</span><br><span class="line">Alice &lt;-- Bob: another authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuGBAAUW2rJY256DHLLoGdrUSoiNbY6fONZvGNP528dP38OfjT7KXgXDngOOO3W00">
<h3 id="声明参与者"><a href="#声明参与者" class="headerlink" title="声明参与者"></a>声明参与者</h3><p>关键字 participant 用于改变参与者的先后顺序。</p>
<p>你也可以使用其它关键字来声明参与者：</p>
<ul>
<li>actor</li>
<li>boundary</li>
<li>control</li>
<li>entity</li>
<li>database</li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">actor Foo1</span><br><span class="line">boundary Foo2</span><br><span class="line">⌃ Foo3</span><br><span class="line">entity Foo4</span><br><span class="line">database Foo5</span><br><span class="line">collections Foo6</span><br><span class="line">Foo1 -&gt; Foo2 : To boundary</span><br><span class="line">Foo1 -&gt; Foo3 : To ⌃</span><br><span class="line">Foo1 -&gt; Foo4 : To entity</span><br><span class="line">Foo1 -&gt; Foo5 : To database</span><br><span class="line">Foo1 -&gt; Foo6 : To collections</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/IqmkoIzISClFD-HAoY_DIqaigWJnZBWUzJI36CPSgNabcILWGHEkbCIInAJ4ubGGpvGhEJyd9pMv93C_hnWaOCO5CaP1rmviW8ALGaY-0inCP2bZY1JG0cHH4uWen3Pa2LE81CngP2apY1IIEm00">
<p>您可以使用关键字 order自定义顺序来打印参与者<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">participant Last order 30</span><br><span class="line">participant Middle order 20</span><br><span class="line">participant First order 10</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/AqWiAibCpYn8p2jHy4aiBb78Bqf9BL8mDk0gG9BnpKn9oKc5oXcXohbb5i6r6He00000">
<h3 id="修改箭头样式"><a href="#修改箭头样式" class="headerlink" title="修改箭头样式"></a>修改箭头样式</h3><p>箭头样式有以下几种:</p>
<ul>
<li>表示一条丢失的消息：末尾加 x</li>
<li>让箭头只有上半部分或者下半部分：将&lt;和&gt;替换成\或者 /</li>
<li>细箭头：将箭头标记写两次 (如 &gt;&gt; 或 //)</li>
<li>虚线箭头：用 – 替代 -</li>
<li>箭头末尾加圈：-&gt;o</li>
<li>双向箭头：<-></-></li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Bob -&gt;x Alice</span><br><span class="line">Bob -&gt; Alice</span><br><span class="line">Bob -&gt;&gt; Alice</span><br><span class="line">Bob -\ Alice</span><br><span class="line">Bob \\- Alice</span><br><span class="line">Bob //-- Alice</span><br><span class="line"></span><br><span class="line">Bob -&gt;o Alice</span><br><span class="line">Bob o\\-- Alice</span><br><span class="line"></span><br><span class="line">Bob &lt;-&gt; Alice</span><br><span class="line">Bob &lt;-&gt;o Alice</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/SyfFKj2rgr1mpCbCJkLo0lDGE2Yy62HEJ8mk4azVNnV6XMhCHvBD1of6aRP1iSK6hXe0">
<p>你可以用以下记号修改箭头的颜色：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Bob -[#red]&gt; Alice : hello</span><br><span class="line">Alice -[#0000FF]-&gt;Bob : ok</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/SyfFKj2DLYvAJOcrKt3CoKnELR1Io4ZDoSddWl20aWP0uEOMgsld15HifP2V3G00">
<h3 id="对消息序列编号"><a href="#对消息序列编号" class="headerlink" title="对消息序列编号"></a>对消息序列编号</h3><p>关键字 autonumber 用于自动对消息编号。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">autonumber</span><br><span class="line">Bob -&gt; Alice : Authentication Request</span><br><span class="line">Bob &lt;- Alice : Authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/IomjoSyhpKrABU9ooazIqBLJSCp9J4vLi59mB2t9ICqhoKnEBCdCprC8IYqiJIqk0QkoqSMjghWWFwyu5G00">
<p>语句 autonumber start 用于指定编号的初始值，而 autonumber startincrement 可以同时指定编号的初始值和每次增加的值。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">autonumber</span><br><span class="line">Bob -&gt; Alice : Authentication Request</span><br><span class="line">Bob &lt;- Alice : Authentication Response</span><br><span class="line"></span><br><span class="line">autonumber 15</span><br><span class="line">Bob -&gt; Alice : Another authentication Request</span><br><span class="line">Bob &lt;- Alice : Another authentication Response</span><br><span class="line"></span><br><span class="line">autonumber 40 10</span><br><span class="line">Bob -&gt; Alice : Yet another authentication Request</span><br><span class="line">Bob &lt;- Alice : Yet another authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/IomjoSyhpKrABU9ooazIqBLJSCp9J4vLi59mB2t9ICqhoKnEBCdCprC8IYqiJIqk0QkoqSMjghWWFwyubOih4MwmWg4fXjbv-K1jHGg9nDc1IpKMkqmC50mDqAsBJ2rHI2J9Ihmw8DO20000">
<p>你还可以用语句 autonumber stop 和 autonumber resume incrementformat 来表示暂停或继续使用自动编号。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">autonumber 10 10 &quot;&lt;b&gt;[000]&quot;</span><br><span class="line">Bob -&gt; Alice : Authentication Request</span><br><span class="line">Bob &lt;- Alice : Authentication Response</span><br><span class="line"></span><br><span class="line">autonumber stop</span><br><span class="line">Bob -&gt; Alice : dummy</span><br><span class="line"></span><br><span class="line">autonumber resume &quot;&lt;font color=red&gt;&lt;b&gt;Message 0  &quot;</span><br><span class="line">Bob -&gt; Alice : Yet another authentication Request</span><br><span class="line">Bob &lt;- Alice : Yet another authentication Response</span><br><span class="line"></span><br><span class="line">autonumber stop</span><br><span class="line">Bob -&gt; Alice : dummy</span><br><span class="line"></span><br><span class="line">autonumber resume 1 &quot;&lt;font color=blue&gt;&lt;b&gt;Message 0  &quot;</span><br><span class="line">Bob -&gt; Alice : Yet another authentication Request</span><br><span class="line">Bob &lt;- Alice : Yet another authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/nS-n2i9030RWlKyHkXUkgzH2tLtSH1pksgW7lKkz98Dlx-aYLHJ1GSZu9_b-gq9HWyC4jRbDsRXsPupPbyMA75GjTAFl4HRGgPmmYk-jU8gmmRCYoptLLEzJF55aB0hx-CH2q_FrGKEup589MGDcq86YG4yZfMN2eSt0DJBR8u81U65kKS16oee4zYlonurV-VMyW1iL_zBW2W00">
<h3 id="组合消息"><a href="#组合消息" class="headerlink" title="组合消息"></a>组合消息</h3><p>我们可以通过以下关键词将组合消息：</p>
<ul>
<li>alt/else</li>
<li>opt</li>
<li>loop</li>
<li>par</li>
<li>break</li>
<li>critical</li>
<li>group, 后面紧跟着消息内容</li>
</ul>
<p>可以在标头(header)添加需要显示的文字(group除外)。</p>
<p>关键词 end 用来结束分组。</p>
<p>注意，分组可以嵌套使用。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Alice -&gt; Bob: Authentication Request</span><br><span class="line"></span><br><span class="line">⌥ successful case</span><br><span class="line"></span><br><span class="line">	Bob -&gt; Alice: Authentication Accepted</span><br><span class="line">	</span><br><span class="line">else some kind of failure</span><br><span class="line"></span><br><span class="line">	Bob -&gt; Alice: Authentication Failure</span><br><span class="line">	group My own label</span><br><span class="line">		Alice -&gt; Log : Log attack start</span><br><span class="line">	    loop 1000 times</span><br><span class="line">	        Alice -&gt; Bob: DNS Attack</span><br><span class="line">	    end</span><br><span class="line">		Alice -&gt; Log : Log attack end</span><br><span class="line">	end</span><br><span class="line">	</span><br><span class="line">else Another type of failure</span><br><span class="line"></span><br><span class="line">   Bob -&gt; Alice: Please repeat</span><br><span class="line">   </span><br><span class="line">end</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/XL1BJWCn35qdftWNg3Hikq0AGgm0LN22DECfKTCun8wgtfxC32n6IE255tuV-zcb60YxUppmSG_Nz8Eonk0rSiORVJOIjTOdXRGGI6Hg2S4BMMkwP5QwsUANrdLsKHgjiPI487mXd6CUmHCc7rEh_teyVTFCgN8hUBc1hnd97obPOzpFwSzymdxfNjM7CqHzLMlGAp4Nt0t308qNadKubzi4VtnzXrl4AuFo-EU61L_QcivbxfTNwAtG9c3tsaOy9EhVGwL2NcVOTfil">
<h3 id="添加注释"><a href="#添加注释" class="headerlink" title="添加注释"></a>添加注释</h3><p>我们可以通过在消息后面添加 note left 或者 note right 关键词来给消息添加注释。</p>
<p>你也可以通过使用 end note 来添加多行注释<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Alice-&gt;Bob : hello</span><br><span class="line">note left: this is a first note</span><br><span class="line"></span><br><span class="line">Bob-&gt;Alice : ok</span><br><span class="line">note right: this is another note</span><br><span class="line"></span><br><span class="line">Bob-&gt;Bob : I am thinking</span><br><span class="line">note left</span><br><span class="line">	a note</span><br><span class="line">	can also be defined</span><br><span class="line">	on several lines</span><br><span class="line">end note</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/JOqn3iCW40HhxXNx0N_0XIMdopFEvZ38bqC2bFS7XyAMjjgTqQwQTfcMLzum8ufg9ijDe1BQZ1PJHGyZf58RhecemzEoNc9tyZc4aexuD7ePfJoDyV46VoxApcJ7_KME1-jsDh3MZ4tW9IGJJouRgdobi49xKqdC__aV">
<p>可以使用note left of，note right of或note over在节点(participant)的相对位置放置注释。</p>
<p>还可以通过修改背景色来高亮显示注释。</p>
<p>以及使用关键字end note来添加多行注释<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">participant Alice</span><br><span class="line">participant Bob</span><br><span class="line">note left of Alice #aqua</span><br><span class="line">	This is displayed </span><br><span class="line">	left of Alice. </span><br><span class="line">end note</span><br><span class="line"> </span><br><span class="line">note right of Alice: This is displayed right of Alice.</span><br><span class="line"></span><br><span class="line">note over Alice: This is displayed over Alice.</span><br><span class="line"></span><br><span class="line">note over Alice, Bob #FFAAAA: This is displayed\n over Bob and Alice.</span><br><span class="line"></span><br><span class="line">note over Bob, Alice</span><br><span class="line">	This is yet another</span><br><span class="line">	example of</span><br><span class="line">	a long note.</span><br><span class="line">end note</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/TP0n3i8m34Nd-1IMkbOz05iPUW965jCwJQIGX3GWUdjIWbggWEN9Vl_Btvv2rBtsP2EsHlSC_cjoT1UmBZ8QbX6Tp0XMTBiJY9FI4wOUzEGDpJmWY1tO8B0TS740p4P1Zse33bXwx8a6iiuzEFpNRDkIhvSKM7LTc-g7-6mpl52KhYrjqgR-F6VDF7DCj8kA0mX-qjMRH4iGXCRPyPsvMTE_0000">
<h3 id="分隔符"><a href="#分隔符" class="headerlink" title="分隔符"></a>分隔符</h3><p>你可以通过使用 == 关键词来将你的图表分割多个步骤。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">== Initialization ==</span><br><span class="line"></span><br><span class="line">Alice -&gt; Bob: Authentication Request</span><br><span class="line">Bob --&gt; Alice: Authentication Response</span><br><span class="line"></span><br><span class="line">== Repetition ==</span><br><span class="line"></span><br><span class="line">Alice -&gt; Bob: Another authentication Request</span><br><span class="line">Alice &lt;-- Bob: another authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/TSqn2e0m30NGFQV81Ne1CO9khjwWbe01ITN6nTCRx5h7pt_99y9PnIJkyaIJh4W4CEwI6CE0Krux76_RM4rI1GkVDnS3xp2u-N13bIDhOG0Y3mUR_BtNx9SNnlPCnNq8LSS_NUTU">
<h3 id="延迟"><a href="#延迟" class="headerlink" title="延迟"></a>延迟</h3><p>你可以使用…来表示延迟，并且还可以给延迟添加注释。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Alice -&gt; Bob: Authentication Request</span><br><span class="line">...</span><br><span class="line">Bob --&gt; Alice: Authentication Response</span><br><span class="line">...5 minutes latter...</span><br><span class="line">Bob --&gt; Alice: Bye !</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFib9mB2t9ICqhoKnEBCdCprC8IYqiJIqkuTBJq-C2oYle0jKvWZHWKLbSa9zNd0fIQggGcvbNMf9Qh92JM5AIMeH5jrDbge8Y0000">
<h3 id="空间"><a href="#空间" class="headerlink" title="空间"></a>空间</h3><p>你可以使用|||来增加空间。</p>
<p>还可以使用数字指定增加的像素的数量。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">Alice -&gt; Bob: message 1</span><br><span class="line">Bob --&gt; Alice: ok</span><br><span class="line">|||</span><br><span class="line">Alice -&gt; Bob: message 2</span><br><span class="line">Bob --&gt; Alice: ok</span><br><span class="line">||45||</span><br><span class="line">Alice -&gt; Bob: message 3</span><br><span class="line">Bob --&gt; Alice: ok</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Syp9J4vLqBLJSCfFibB8JIqkJanFLJ3a0d8LT872ZY1vAuNyRAwQcXekHwogZR2gDZ75gS4OKmC0">
<h3 id="生命线的激活与撤销"><a href="#生命线的激活与撤销" class="headerlink" title="生命线的激活与撤销"></a>生命线的激活与撤销</h3><p>关键字activate和deactivate用来表示参与者的生命活动。<br>一旦参与者被激活，它的生命线就会显示出来。<br>activate和deactivate适用于以上情形。<br>destroy表示一个参与者的生命线的终结。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">participant User</span><br><span class="line"></span><br><span class="line">[-&gt; User: DoWork</span><br><span class="line"></span><br><span class="line">User -&gt; A: DoWork</span><br><span class="line">activate A #FFBBBB</span><br><span class="line"></span><br><span class="line">A -&gt; A: Internal call</span><br><span class="line">activate A #DarkSalmon</span><br><span class="line"></span><br><span class="line">A -&gt; B: &lt;&lt; createRequest &gt;&gt;</span><br><span class="line">activate B</span><br><span class="line"></span><br><span class="line">B --&gt; A: RequestCreated</span><br><span class="line">deactivate B</span><br><span class="line">deactivate A</span><br><span class="line">A -&gt; User: Done</span><br><span class="line"></span><br><span class="line">[&lt;- User: Done</span><br><span class="line">deactivate A</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/LO-n3i8m34HtVuKbvln05KLAg2gnWX03avLwY1gIaWQ-dz0629vyv-UJRgQKdNKpXOpdXHF0LQXrwx2FbvWcWBV2ukglHJQx9sL6ZRjXC6K0T4KE8NCAvD6IztzaJsawaR_5K6dJePHe4nVWoFS7BncL-lsKL8DYYwtt_GgFC793DK9loPy2WKiXALhTmYy0">
<h3 id="移除脚注"><a href="#移除脚注" class="headerlink" title="移除脚注"></a>移除脚注</h3><p>使用hide footbox关键字移除脚注。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">hide footbox</span><br><span class="line">title Footer removed</span><br><span class="line"></span><br><span class="line">Alice -&gt; Bob: Authentication Request</span><br><span class="line">Bob --&gt; Alice: Authentication Response</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/RSgn3O0W44RXdYbk0HUmCC720Tn0u3TSWfp2OHnVOctvyhx80RIBg9F7A6i2BRrGgE2G6y4OczY3XebcSIFPfX5PsM_Aacd5rL3Lz4T3Dn_-KVMKNF42">
<h3 id="包裹参与者"><a href="#包裹参与者" class="headerlink" title="包裹参与者"></a>包裹参与者</h3><p>可以使用box和end box画一个盒子将参与者包裹起来。<br>还可以在box关键字之后添加标题或者背景颜色。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">box &quot;Internal Service&quot; #LightBlue</span><br><span class="line">	participant Bob</span><br><span class="line">	participant Alice</span><br><span class="line">end box</span><br><span class="line">participant Other</span><br><span class="line"></span><br><span class="line">Bob -&gt; Alice : hello</span><br><span class="line">Alice -&gt; Other : hello</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/IyglK53op2j9BSfBp548JYqgoqnELL9GzibCpoXnoYbDvU8iI2mgoKpEB4ZCAr5moaz25N3C0QhdIirBKKZAh-12bl4loKWjuk82wb3GjOEeKx1Io4ZDoSddWl20mc15C640">
<h2 id="流程图"><a href="#流程图" class="headerlink" title="流程图"></a>流程图</h2><p>这里只介绍新语法<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line">:Hello world;</span><br><span class="line">:This is on defined on</span><br><span class="line">several **lines**;</span><br><span class="line">end</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/Aov9B2hXil98pSd9LoZFByf9iUQo2id8B5O0elmyXPJKjCoyr1GWawiujIorA357GKih1oXKhALbpPMQbm80">
<h3 id="条件语句"><a href="#条件语句" class="headerlink" title="条件语句"></a>条件语句</h3><p>在图示中可以使用关键字if，then和else设置分支测试。标注文字则放在括号中。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line"></span><br><span class="line">if (condition A) then (yes)</span><br><span class="line">  :gogogo;</span><br><span class="line">elseif (condition B) then (yes)</span><br><span class="line">  :Text 2;</span><br><span class="line">  stop</span><br><span class="line">elseif (condition C) then (yes)</span><br><span class="line">  :Text 3;</span><br><span class="line">else (no)</span><br><span class="line">  :process only</span><br><span class="line">  __sequence__ and __activity__ diagrams;</span><br><span class="line">endif</span><br><span class="line"></span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/ROqz3i8m38Ltdy9Zky969-0Ax56KkCLIiKji4BazAKoWoilpf_TZ7ei3y8XTKidih8B77lrAWbqbwm7nCEbw0z1iz6iz_Lilz7BS3KsQwxAHE6yczjzox4G_S2cQo0nLvjh-48pk3v948M2Kt41Cpa_ssa3cE9LuizRHLaQ0TVeD">
<h3 id="重复"><a href="#重复" class="headerlink" title="重复"></a>重复</h3><p>你可以使用关键字repeat和repeatwhile进行重复循环。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line"></span><br><span class="line">repeat</span><br><span class="line">  :read data;</span><br><span class="line">  :generate diagrams;</span><br><span class="line">repeat while (more data?)</span><br><span class="line"></span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/BSf12e0m30J0UrwHetx17dpBGfPQiBOa0RylYiU1YOIdY7CIAQgR4wQ6H7bLUT6HL6keZXxbhteVxQGkVJY_lgyYaMC-">
<h3 id="while循环"><a href="#while循环" class="headerlink" title="while循环"></a>while循环</h3><p>可以使用关键字while和end while进行while循环。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line"></span><br><span class="line">while (data available?)</span><br><span class="line">  :read data;</span><br><span class="line">  :generate diagrams;</span><br><span class="line">endwhile</span><br><span class="line"></span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/7Sj12e0m34JHVKwHfLx1BZpBI8PQQAkaGQylTVbv_17m47dFKgcB8Q1uK2gEodqLrSq9qmbfLcQd8wXMa1rj966tVnSPSTqV">
<h3 id="并行处理"><a href="#并行处理" class="headerlink" title="并行处理"></a>并行处理</h3><p>你可以使用关键字fork，fork again和end fork表示并行处理。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line"></span><br><span class="line">if (multiprocessor?) then (yes)</span><br><span class="line">  fork</span><br><span class="line">	:Treatment 1;</span><br><span class="line">  fork again</span><br><span class="line">	:Treatment 2;</span><br><span class="line">  end fork</span><br><span class="line">else (monoproc)</span><br><span class="line">  :Treatment 1;</span><br><span class="line">  :Treatment 2;</span><br><span class="line">endif</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/NSmn4a1038NXsfuY9IKbXKkum0vPTf2O90gtjpiqjE_D_wbvCUTYW78_Duk7y8YgB7q5jY11UQ5M3Y2mhAve1q5lEv91tRqh-Db7-dnD_f2cfy9DCV5CdFMC_Pblci8ORW00">
<h3 id="注释"><a href="#注释" class="headerlink" title="注释"></a>注释</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line">:foo1;</span><br><span class="line">floating note left: This is a note</span><br><span class="line">:foo2;</span><br><span class="line">note right</span><br><span class="line">  This note is on several</span><br><span class="line">  //lines// and can</span><br><span class="line">  contain &lt;b&gt;HTML&lt;/b&gt;</span><br><span class="line">  ====</span><br><span class="line">  * Calling the method &quot;&quot;foo()&quot;&quot; is prohibited</span><br><span class="line">end note</span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/9Own3i8m34JtV8NL2LWY6DlIXOK1jlw0sxfDf61NYSNtumRBqadFf_CLnQokNKMkdLkJe4RUW4K94gtQmXXY0Lkii3fldQk67BUW3lwMIao5eT2NCYQxU9yYK_4Ua1UOaOtDmegHeP-6v_X-zNuQZDvjJ2xmm9IE2Xe8FgH15cWQUtewDysHlsS9SOfAYoFBhAMAolu3">
<h3 id="箭头"><a href="#箭头" class="headerlink" title="箭头"></a>箭头</h3><p>使用-&gt;标记，你可以给箭头添加文字或者修改箭头颜色。<br>同时，你也可以选择点状 (dotted)，条状(dashed)，加粗或者是隐式箭头<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:foo1;</span><br><span class="line">-&gt; You can put text on arrows;</span><br><span class="line">if (test) then</span><br><span class="line">  -[#blue]-&gt;</span><br><span class="line">  :foo2;</span><br><span class="line">  -[#green,dashed]-&gt; The text can</span><br><span class="line">  also be on several lines</span><br><span class="line">  and **very** long...;</span><br><span class="line">  :foo3;</span><br><span class="line">else</span><br><span class="line">  -[#black,dotted]-&gt;</span><br><span class="line">  :foo4;</span><br><span class="line">endif</span><br><span class="line">-[#gray,bold]-&gt;</span><br><span class="line">:foo5;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/DOv93i8m34NtEOKbDX2rbPWsHEefs2348ctSGKGsIboWjoSTMFg_h_TzQPZtHkKbt7Y0sXAy1W71hm0Js13u4utg6zWAHjc1T4WA8BzlAZ_W8o_JSKcEWrdIDY1Ivcpiq2KArmuNMrAdXlMHeSB97V6DmNhmFM6S43dGEcMZrk2Psg8ep6e_6eK-ud_Ori_CiSWyiLPEgKAkRzJyX1spYlsC9tWsFm00">
<h3 id="组合"><a href="#组合" class="headerlink" title="组合"></a>组合</h3><p>通过定义分区(partition)，你可以把多个活动组合(group)在一起。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line">partition Initialization &#123;</span><br><span class="line">	:read config file;</span><br><span class="line">	:init internal variable;</span><br><span class="line">&#125;</span><br><span class="line">partition Running &#123;</span><br><span class="line">	:wait for user interaction;</span><br><span class="line">	:print information;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/JOn13eCm30JFpIlyZl82hlt15X9aANKYnxGIYB_ZmAKNMvvTJpEeXUg3ZOlGABwHUSDrxk7nr8YPfYA95qgSu-2ClKOi5bMGwGjbl7jo_AbUgmZBSZb-y7ugIckBUZzYwgqkg-h0eUSVtF08eLcf9m00">
<h3 id="泳道"><a href="#泳道" class="headerlink" title="泳道"></a>泳道</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">|Swimlane1|</span><br><span class="line">start</span><br><span class="line">:foo1;</span><br><span class="line">|#AntiqueWhite|Swimlane2|</span><br><span class="line">:foo2;</span><br><span class="line">:foo3;</span><br><span class="line">|Swimlane1|</span><br><span class="line">:foo4;</span><br><span class="line">|Swimlane2|</span><br><span class="line">:foo5;</span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure>
<img src="http://www.plantuml.com/plantuml/svg/gmakpypDISnBDQpXAYv9B2hXiahBppUqvgfHTimhoImiJGtFo2n9hO4fCwe1Ap2o1bF6G7L81e24J924e8fDhO56vnS00000">
<h3 id="分离"><a href="#分离" class="headerlink" title="分离"></a>分离</h3><p>可以使用关键字detach移除箭头。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:start;</span><br><span class="line"> fork</span><br><span class="line">   :foo1;</span><br><span class="line">   :foo2;</span><br><span class="line"> fork again</span><br><span class="line">   :foo3;</span><br><span class="line">   detach</span><br><span class="line"> endfork</span><br><span class="line"> if (foo4) then</span><br><span class="line">   :foo5;</span><br><span class="line">   detach</span><br><span class="line"> endif</span><br><span class="line"> :foo6;</span><br><span class="line"> detach</span><br><span class="line"> :foo7;</span><br><span class="line"> stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/ioekIImgiUPIICilokPIK52mIilFDxI6iOoWCWg9wOcPUJ1HOx1yIcf9Od86bq9gNWf4SsQQWWPGraHJeIGZ5QxO55rnPXeNMC8CA04J1l7DWVpYalm20000">
<p>一个比较完整的例子<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">start</span><br><span class="line">:ClickServlet.handleRequest();</span><br><span class="line">:new page;</span><br><span class="line">if (Page.onSecurityCheck) then (true)</span><br><span class="line">  :Page.onInit();</span><br><span class="line">  if (isForward?) then (no)</span><br><span class="line">	:Process controls;</span><br><span class="line">	if (continue processing?) then (no)</span><br><span class="line">	  stop</span><br><span class="line">	endif</span><br><span class="line">	</span><br><span class="line">	if (isPost?) then (yes)</span><br><span class="line">	  :Page.onPost();</span><br><span class="line">	else (no)</span><br><span class="line">	  :Page.onGet();</span><br><span class="line">	endif</span><br><span class="line">	:Page.onRender();</span><br><span class="line">  endif</span><br><span class="line">else (false)</span><br><span class="line">endif</span><br><span class="line"></span><br><span class="line">if (do redirect?) then (yes)</span><br><span class="line">  :redirect process;</span><br><span class="line">else</span><br><span class="line">  if (do forward?) then (yes)</span><br><span class="line">	:Forward request;</span><br><span class="line">  else (no)</span><br><span class="line">	:Render page template;</span><br><span class="line">  endif</span><br><span class="line">endif</span><br><span class="line"></span><br><span class="line">stop</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/NL4xSiCW5Ap5ALufDJu0Ab9u9fbq6li46hIo61DGuCaUtpvyX9Eu0jv-M9R0esSXZqQhwnd-Pi27PRIJmGdV6mAtNI-anPtMyO9Uw9dQ8UuEpfwXDg_vSLoWhXtn0aij-msT898xwTFgR46Kb3gyEtyV_VHM-TPref63TmeXa7AMlJEX5qsYfwEs6sWjkBQN_qAYm6uL3UoaPz4KbGw32_maFX0oioPAO4hKm0GyVIhwWHqiZdLyYcVuyf025VKyngKJPPJBcHnvJDf3lKI8TrIWlgVFBditKJY_b5EYoxspw9j_96VupIvBjlm_nFXQpSZuaxD4Iptz0000">
<h2 id="用例图"><a href="#用例图" class="headerlink" title="用例图"></a>用例图</h2><h3 id="用例"><a href="#用例" class="headerlink" title="用例"></a>用例</h3><p>用例用圆括号括起来, 也可以用关键字usecase来定义用例。 还可以用关键字as定义一个别名，这个别名可以在以后定义关系的时候使用。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">(First usecase)</span><br><span class="line">(Another usecase) as (UC2)  </span><br><span class="line">usecase UC3</span><br><span class="line">usecase (Last\nusecase) as UC4</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/qt3BB2ekKIWjJarEB4xLvD9mpCiloKWjWeie91OhQ8Gw6sagA711nHH2dOtXR0sVnEAIc3navQ7E9W00">
<h3 id="角色"><a href="#角色" class="headerlink" title="角色"></a>角色</h3><p>角色用两个冒号包裹起来, 也可以用actor关键字来定义角色。 还可以用关键字as来定义一个别名，这个别名可以在以后定义关系的时候使用。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:First Actor:</span><br><span class="line">:Another\nactor: as Men2  </span><br><span class="line">actor Men3</span><br><span class="line">actor :Last actor: as Men4</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/itBBB2ekKN1CBialikAoSipBByb8BOh9ImGBA2GMA_YcvXafA7211K0SOoZJoYSHg155dGa0">
<h3 id="用例描述"><a href="#用例描述" class="headerlink" title="用例描述"></a>用例描述</h3><p>如果想定义跨越多行的用例描述，可以用双引号将其裹起来。还可以使用这些分隔符：–..==__。 并且还可以在分隔符中间放置标题。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">usecase UC1 as &quot;You can use</span><br><span class="line">several lines to define your usecase.</span><br><span class="line">You can also use separators.</span><br><span class="line">--</span><br><span class="line">Several separators are possible.</span><br><span class="line">==</span><br><span class="line">And you can add titles:</span><br><span class="line">..Conclusion..</span><br><span class="line">This allows large description.&quot;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/HOwn2W8n44JxVCLYVm5RuGgvJr0BopLPDR1aZqoY-FScgDWjC_CUso218NHQjiIWpTaQ1SxK80xoaC9AchA0gb6KQp_fPQsCmG2z-n6ii94IPEN2rGgycoPt-5h-CN4HMWr85-s2UNRx78VruucHQgegs3dl5yj16v9bxztndZgiQa-GShb9_mYXfBMEVlC6">
<h3 id="基础用例"><a href="#基础用例" class="headerlink" title="基础用例"></a>基础用例</h3><p>用箭头–&gt;连接角色和用例。<br>横杠-越多，箭头越长。 通过在箭头定义的后面加一个冒号及文字的方式来添加标签。<br>在这个例子中，User并没有定义，而是直接拿来当做一个角色使用。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">User -&gt; (Start)</span><br><span class="line">User --&gt; (Use the application) : A small label</span><br><span class="line"></span><br><span class="line">:Main Admin: ---&gt; (Use the application) : This is\nyet another\nlabel</span><br><span class="line">&#123;% endplantuml %&#125;</span><br><span class="line"></span><br><span class="line">如果一个角色或者用例继承于另一个，那么可以用&lt;|--符号表示</span><br><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:Main Admin: as Admin</span><br><span class="line">(Use the application) as (Use)</span><br><span class="line"></span><br><span class="line">User &lt;|-- Admin</span><br><span class="line">(Start) &lt;|-- (Use)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/VOon3O0m30JxJF4b52oG0ea1g82Ena0aB3aEIjomFO41wFvVTx-KaD7rQ2QZRArRlluEDS7E0BekuPsCaxRm650YYK1e2-AS7uaLmn5PVVL-nFda0Ywhti50cYgIL_rk7W00">
<p>如果一个角色或者用例继承于另一个，那么可以用&lt;|–符号表示<br><img src="http://www.plantuml.com/plantuml/svg/i_9DpCnJS4p9pSopKaWiXh2uD4ABKnLACb8L4WiASZAJ4qioy_CqGT8W2KqkBY1Pf61JewiBKnzSabXKeWaH0gi10000"></p>
<h3 id="注释-1"><a href="#注释-1" class="headerlink" title="注释"></a>注释</h3><p>可以用note left of , note right of , note top of , note bottom of等关键字给一个对象添加注释。<br>注释还可以通过note关键字来定义，然后用..连接其他对象。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:Main Admin: as Admin</span><br><span class="line">(Use the application) as (Use)</span><br><span class="line"></span><br><span class="line">User -&gt; (Start)</span><br><span class="line">User --&gt; (Use)</span><br><span class="line"></span><br><span class="line">Admin ---&gt; (Use)</span><br><span class="line"></span><br><span class="line">note right of Admin : This is an example.</span><br><span class="line"></span><br><span class="line">note right of (Use)</span><br><span class="line">  A note can also</span><br><span class="line">  be on several lines</span><br><span class="line">end note</span><br><span class="line"></span><br><span class="line">note &quot;This note is connected\nto several objects.&quot; as N2</span><br><span class="line">(Start) .. N2</span><br><span class="line">N2 .. (Use)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/NOyn3i8m34NtdEAhKplGeMC7f1w0Bi36uhQ61gLEbKI8uvEa5KX8KVBz_6t7xOcqe9iMBIt8RqgLLyy8CuFMrUYHWhPIfNHAL4h5s-5mH7aEv4Arnmbi-TmbWXyH6nXEF-O0Uz-ceCLbrXxna83VjAo6wt_hLWzqo7oCLZBUHZ8mhC3pYnqP62ti5SkKVNkN8W_8ChwZ5U4ny7IJOB-5TdX6wEiYxTStQjy9TPsYlaaYV-83">
<h3 id="改变箭头方向"><a href="#改变箭头方向" class="headerlink" title="改变箭头方向"></a>改变箭头方向</h3><p>默认连接是竖直方向的，用–表示，可以用一个横杠或点来表示水平连接。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:user: --&gt; (Use case 1)</span><br><span class="line">:user: -&gt; (Use case 2)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/ioejJYsoKj3LjLFG22rELKXE11A6cbnMK75aOIDD0000">
<p>也可以通过翻转箭头来改变方向。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">(Use case 1) &lt;.. :user:</span><br><span class="line">(Use case 2) &lt;- :user:</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/qmWjJbL8JWGIXfeADdfw2bQbnQb5LbmQS74ZeBWkL1W0">
<p>还可以通过给箭头添加left, right, up或down等关键字来改变方向。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">:user: -left-&gt; (dummyLeft) </span><br><span class="line">:user: -right-&gt; (dummyRight) </span><br><span class="line">:user: -up-&gt; (dummyUp)</span><br><span class="line">:user: -down-&gt; (dummyDown)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/ioejJYsoKj3DIKqhqRLJq4WfpSsjz05oD1MuhA1oHPdf6GZ9810FIRQq02uLMg095qx9By-3IxW0EPe0">
<p>默认从上往下构建图示, 你可以用left to right direction命令改变图示方向。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">left to right direction</span><br><span class="line">user1 --&gt; (Usecase 1)</span><br><span class="line">user2 --&gt; (Usecase 2)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/oqbDAr4eoLSeoapFA558oInAJIx9pC_ZAYrEBJ9KqDMrKz08BKvDJYnELJ3K18iQeOeQQG80">
<h3 id="改变颜色"><a href="#改变颜色" class="headerlink" title="改变颜色"></a>改变颜色</h3><p>用skinparam改变字体和颜色。<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">skinparam handwritten true</span><br><span class="line"></span><br><span class="line">skinparam usecase &#123;</span><br><span class="line">	BackgroundColor DarkSeaGreen</span><br><span class="line">	BorderColor DarkSlateGray</span><br><span class="line"></span><br><span class="line">	BackgroundColor&lt;&lt; Main &gt;&gt; YellowGreen</span><br><span class="line">	BorderColor&lt;&lt; Main &gt;&gt; YellowGreen</span><br><span class="line">	</span><br><span class="line">	ArrowColor Olive</span><br><span class="line">	ActorBorderColor black</span><br><span class="line">	ActorFontName Courier</span><br><span class="line"></span><br><span class="line">	ActorBackgroundColor&lt;&lt; Human &gt;&gt; Gold</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">User &lt;&lt; Human &gt;&gt;</span><br><span class="line">:Main Database: as MySql &lt;&lt; Application &gt;&gt;</span><br><span class="line">(Start) &lt;&lt; One Shot &gt;&gt;</span><br><span class="line">(Use the application) as (Use) &lt;&lt; Main &gt;&gt;</span><br><span class="line"></span><br><span class="line">User -&gt; (Start)</span><br><span class="line">User --&gt; (Use)</span><br><span class="line"></span><br><span class="line">MySql --&gt; (Use)</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/TP31ReD034JFyLVus1pw0r64b2OgkQGve1vwTC0gAvOrDQOeglhlPGbDaL2FddcUyMvRkT2GKeqbXQ9NPyO1JJi6QEzUrt9EBUCNh9uehzvLkb3inOlYWRJAc59b3eChMh3E74_6gT8L5flRBPx81KmIV6FlfLz6_8V0QgSg_QtcxDqd3qfkelFwYn_w9lrPWhrGpRYNJXqh_FABauvTJMDXAhw0Ru3NbXLd1cp6amvaT1c-P8FKukcQVVW8xPh6kvpCoOW-P4Pgw-YS0sDMYetoa8bMCj8VleuvqHZfwTLJ-sE2Kz8qHo6Y0BVck_03">
<p>一个较完整的例子<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">&#123;% plantuml %&#125;</span><br><span class="line">left to right direction</span><br><span class="line">skinparam packageStyle rectangle</span><br><span class="line">actor customer</span><br><span class="line">actor clerk</span><br><span class="line">rectangle checkout &#123;</span><br><span class="line">  customer -- (checkout)</span><br><span class="line">  (checkout) .&gt; (payment) : include</span><br><span class="line">  (help) .&gt; (checkout) : extends</span><br><span class="line">  (checkout) -- clerk</span><br><span class="line">&#125;</span><br><span class="line">&#123;% endplantuml %&#125;</span><br></pre></td></tr></table></figure></p>
<img src="http://www.plantuml.com/plantuml/svg/LOv12eCm44NtESLVseKzW8jUeYSO9bCJ4fEGZ50flNiLKUdoyHwV7-Mbq8pgHwUmlWghpycqu5EXIXCASQ1Hdhf4mQOfZL4CiUOAdflcIUg1KMemPmHsmY7FYe_1sQBlqHtcjeeBS7-WAxHCabOOu1F7sShME8bbzrSzGDugoRR_aNL_F_Bz0G00">
      
    </div>

    

    
    
    

    

    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>Tonny Yi</li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="http://codertang.com/2019/02/21/hexo-drawing-plantuml/" title="在hexo中画图-PlantUml">http://codertang.com/2019/02/21/hexo-drawing-plantuml/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc/4.0/" rel="external nofollow" target="_blank">CC BY-NC 4.0</a> 许可协议。转载请注明出处！</li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/uml/" rel="tag"># uml</a>
          
            <a href="/tags/hexo/" rel="tag"># hexo</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/01/10/shell/" rel="next" title="shell">
                <i class="fa fa-chevron-left"></i> shell
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/02/21/hexo-drawing-echarts/" rel="prev" title="在hexo中画图-ECharts">
                在hexo中画图-ECharts <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/avatar.png" alt="Tonny Yi">
            
              <p class="site-author-name" itemprop="name">Tonny Yi</p>
              <p class="site-description motion-element" itemprop="description">Coding, Life, Zen</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/archives/">
                
                    <span class="site-state-item-count">49</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  <a href="/categories/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">42</span>
                    <span class="site-state-item-name">分类</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">59</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  <a href="https://github.com/tonnyyi" target="_blank" title="GitHub"><i class="fa fa-fw fa-github"></i>GitHub</a>
                  
                </span>
              
                <span class="links-of-author-item">
                  <a href="mailto:tonnyemails@gmail.com" target="_blank" title="E-Mail"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  
                </span>
              
            </div>
          

          
          
            <div class="cc-license motion-element" itemprop="license">
              <a href="https://creativecommons.org/licenses/by-nc/4.0/" class="cc-opacity" target="_blank">
                <img src="/images/cc-by-nc.svg" alt="Creative Commons">
              </a>
            </div>
          

          
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#PlantUml"><span class="nav-number">1.</span> <span class="nav-text">PlantUml</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#安装"><span class="nav-number">1.1.</span> <span class="nav-text">安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#使用"><span class="nav-number">1.2.</span> <span class="nav-text">使用</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#类图"><span class="nav-number">1.2.1.</span> <span class="nav-text">类图</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#包"><span class="nav-number">1.2.1.1.</span> <span class="nav-text">包</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#抽象类与接口"><span class="nav-number">1.2.1.2.</span> <span class="nav-text">抽象类与接口</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#抽象与静态"><span class="nav-number">1.2.1.3.</span> <span class="nav-text">抽象与静态</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#关系"><span class="nav-number">1.2.1.4.</span> <span class="nav-text">关系</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#类方法"><span class="nav-number">1.2.1.5.</span> <span class="nav-text">类方法</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#方法可见性"><span class="nav-number">1.2.1.6.</span> <span class="nav-text">方法可见性</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#方法属性分组"><span class="nav-number">1.2.1.7.</span> <span class="nav-text">方法属性分组</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#备注"><span class="nav-number">1.2.1.8.</span> <span class="nav-text">备注</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#时序图"><span class="nav-number">1.3.</span> <span class="nav-text">时序图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#声明参与者"><span class="nav-number">1.3.1.</span> <span class="nav-text">声明参与者</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#修改箭头样式"><span class="nav-number">1.3.2.</span> <span class="nav-text">修改箭头样式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#对消息序列编号"><span class="nav-number">1.3.3.</span> <span class="nav-text">对消息序列编号</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#组合消息"><span class="nav-number">1.3.4.</span> <span class="nav-text">组合消息</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#添加注释"><span class="nav-number">1.3.5.</span> <span class="nav-text">添加注释</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#分隔符"><span class="nav-number">1.3.6.</span> <span class="nav-text">分隔符</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#延迟"><span class="nav-number">1.3.7.</span> <span class="nav-text">延迟</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#空间"><span class="nav-number">1.3.8.</span> <span class="nav-text">空间</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#生命线的激活与撤销"><span class="nav-number">1.3.9.</span> <span class="nav-text">生命线的激活与撤销</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#移除脚注"><span class="nav-number">1.3.10.</span> <span class="nav-text">移除脚注</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#包裹参与者"><span class="nav-number">1.3.11.</span> <span class="nav-text">包裹参与者</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#流程图"><span class="nav-number">1.4.</span> <span class="nav-text">流程图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#条件语句"><span class="nav-number">1.4.1.</span> <span class="nav-text">条件语句</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#重复"><span class="nav-number">1.4.2.</span> <span class="nav-text">重复</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#while循环"><span class="nav-number">1.4.3.</span> <span class="nav-text">while循环</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#并行处理"><span class="nav-number">1.4.4.</span> <span class="nav-text">并行处理</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#注释"><span class="nav-number">1.4.5.</span> <span class="nav-text">注释</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#箭头"><span class="nav-number">1.4.6.</span> <span class="nav-text">箭头</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#组合"><span class="nav-number">1.4.7.</span> <span class="nav-text">组合</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#泳道"><span class="nav-number">1.4.8.</span> <span class="nav-text">泳道</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#分离"><span class="nav-number">1.4.9.</span> <span class="nav-text">分离</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#用例图"><span class="nav-number">1.5.</span> <span class="nav-text">用例图</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#用例"><span class="nav-number">1.5.1.</span> <span class="nav-text">用例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#角色"><span class="nav-number">1.5.2.</span> <span class="nav-text">角色</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#用例描述"><span class="nav-number">1.5.3.</span> <span class="nav-text">用例描述</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#基础用例"><span class="nav-number">1.5.4.</span> <span class="nav-text">基础用例</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#注释-1"><span class="nav-number">1.5.5.</span> <span class="nav-text">注释</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#改变箭头方向"><span class="nav-number">1.5.6.</span> <span class="nav-text">改变箭头方向</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#改变颜色"><span class="nav-number">1.5.7.</span> <span class="nav-text">改变颜色</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2021</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tonny Yi</span>

  

  
</div>


  <script src="https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>





  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://theme-next.org">NexT.Mist</a></div>




        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>


























  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=6.3.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=6.3.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=6.3.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=6.3.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=6.3.0"></script>



  



	





  





  










  





  

  

  

  

  
  

  

  

  

  

  
  <style>
    .copy-btn {
      display: inline-block;
      padding: 6px 12px;
      font-size: 13px;
      font-weight: 700;
      line-height: 20px;
      color: #333;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer;
      background-color: #eee;
      background-image: linear-gradient(#fcfcfc, #eee);
      border: 1px solid #d5d5d5;
      border-radius: 3px;
      user-select: none;
      outline: 0;
    }

    .highlight-wrap .copy-btn {
      transition: opacity .3s ease-in-out;
      opacity: 0;
      padding: 2px 6px;
      position: absolute;
      right: 4px;
      top: 8px;
    }

    .highlight-wrap:hover .copy-btn,
    .highlight-wrap .copy-btn:focus {
      opacity: 1
    }

    .highlight-wrap {
      position: relative;
    }
  </style>
  <script>
    $('.highlight').each(function (i, e) {
      var $wrap = $('<div>').addClass('highlight-wrap')
      $(e).after($wrap)
      $wrap.append($('<button>').addClass('copy-btn').append('复制').on('click', function (e) {
        var code = $(this).parent().find('.code').find('.line').map(function (i, e) {
          return $(e).text()
        }).toArray().join('\n')
        var ta = document.createElement('textarea')
        document.body.appendChild(ta)
        ta.style.position = 'absolute'
        ta.style.top = '0px'
        ta.style.left = '0px'
        ta.value = code
        ta.select()
        ta.focus()
        var result = document.execCommand('copy')
        document.body.removeChild(ta)
        
          if(result)$(this).text('复制成功')
          else $(this).text('复制失败')
        
        $(this).blur()
      })).on('mouseleave', function (e) {
        var $b = $(this).find('.copy-btn')
        setTimeout(function () {
          $b.text('复制')
        }, 300)
      }).append(e)
    })
  </script>


</body>
</html>
